pub mod x86_64;

use crate::boot::bootinfo::BootInfo;
use crate::driver::video::*;

pub fn kernel_main(bootinfo: &'static BootInfo) -> ! {
    let (x, y, fb_pointer) = (
        bootinfo.mib.x_resolution as usize,
        bootinfo.mib.y_resolution as usize,
        bootinfo.mib.phys_base_ptr,
    );
    let p = get_fb(x, y, fb_pointer);
    for i in 0..(x * y) {
        let j = (i % 256) as u8;
        p[i] = Rgb {
            a: 0,
            r: j,
            g: j,
            b: j,
        };
    }

    let mbox = Box::new(
        [x86_64::paging::PageTableEntry::new_with_address(0, x86_64::paging::PageTableEntry::PS);
            512],
    );

    die()
}
